﻿using System;
using Autodesk.Revit.DB;

namespace YJKRevitCurveDrag
{
	public class JigTextInfo
	{
		public TextNoteType theTextNoteType
		{
			get
			{
				return this.m_TextNoteType;
			}
			set
			{
				this.m_TextNoteType = value;
			}
		}

		public XYZ Origin
		{
			get
			{
				return this.m_Origin;
			}
			set
			{
				this.m_Origin = value;
			}
		}

		public XYZ BaseVec
		{
			get
			{
				return this.m_BaseVec;
			}
			set
			{
				this.m_BaseVec = value;
			}
		}

		public XYZ UpVec
		{
			get
			{
				return this.m_UpVec;
			}
			set
			{
				this.m_UpVec = value;
			}
		}

		public double LineWidth
		{
			get
			{
				return this.m_LineWidth;
			}
			set
			{
				this.m_LineWidth = value;
			}
		}

		public TextAlignFlags TextAlign
		{
			get
			{
				return this.m_TextAlign;
			}
			set
			{
				this.m_TextAlign = value;
			}
		}

		public string StrText
		{
			get
			{
				return this.m_StrText;
			}
			set
			{
				this.m_StrText = value;
			}
		}

		public JigTextInfo(JigTextInfo rhs)
		{
			this.m_TextNoteType = rhs.m_TextNoteType;
			this.m_Origin = rhs.m_Origin;
			this.m_BaseVec = rhs.m_BaseVec;
			this.m_UpVec = rhs.m_UpVec;
			this.m_TextAlign = rhs.m_TextAlign;
			this.m_LineWidth = rhs.m_LineWidth;
			this.m_StrText = rhs.m_StrText;
		}

		public JigTextInfo(TextNoteType textNoteType, XYZ origin, XYZ baseVec, XYZ upVec, TextAlignFlags textAlign, double lineWidth, string strText)
		{
			this.m_TextNoteType = textNoteType;
			this.m_Origin = origin;
			this.m_BaseVec = baseVec;
			this.m_UpVec = upVec;
			this.m_TextAlign = textAlign;
			this.m_LineWidth = lineWidth;
			this.m_StrText = strText;
		}

		public JigTextInfo TransformTo(Transform matrix, bool transformCoordinateSystem = false)
		{
			XYZ origin = JigGeometry.TransformPoint(this.Origin, matrix);
			if (transformCoordinateSystem)
			{
				this.BaseVec = JigGeometry.TransformPoint(this.BaseVec, matrix);
				this.UpVec = JigGeometry.TransformPoint(this.UpVec, matrix);
			}
			return new JigTextInfo(this.theTextNoteType, origin, this.BaseVec, this.UpVec, this.TextAlign, this.LineWidth, this.StrText);
		}

		public void TransformSelf(Transform matrix, bool transformCoordinateSystem = false)
		{
			this.Origin = JigGeometry.TransformPoint(this.Origin, matrix);
			if (transformCoordinateSystem)
			{
				this.BaseVec = JigGeometry.TransformPoint(this.BaseVec, matrix);
				this.UpVec = JigGeometry.TransformPoint(this.UpVec, matrix);
			}
		}

		private TextNoteType m_TextNoteType;

		private XYZ m_Origin;

		private XYZ m_BaseVec;

		private XYZ m_UpVec;

		private double m_LineWidth;

		private TextAlignFlags m_TextAlign;

		private string m_StrText;
	}
}
